package com.central.apps.common.constant;

/**
 * 项目月份统计字段枚举类
 *
 * @author 李大超
 * @date 2022/9/29
 */
public enum ProjectMonthEnum {
    /*
     * 12个月份统计字段名称
     */
    JAN(1,"janquantiry"),
    FEB(2,"febquantiry"),
    MAR(3,"marquantiry"),
    APR(4,"aprquantiry"),
    MAY(5,"mayquantiry"),
    JUN(6,"junquantiry"),
    JUL(7,"julquantiry"),
    AUG(8,"augquantiry"),
    SEP(9,"sepquantiry"),
    OCT(10,"octquantiry"),
    NOV(11,"novquantiry"),
    DEC(12,"decquantiry");

    private int month;
    private String monthField;

    ProjectMonthEnum(int month, String monthField) {
        this.month = month;
        this.monthField = monthField;
    }

    /**
     * 获取月份字段名称
     *
     * @param month
     * @return
     */
    public static String getMonthField(int month) {
        for (ProjectMonthEnum pm : ProjectMonthEnum.values()) {
            if (pm.getMonth() == month) {
                return pm.getMonthField();
            }
        }
        return null;
    }

    public int getMonth() {
        return month;
    }

    public void setMonth(int month) {
        this.month = month;
    }

    public String getMonthField() {
        return monthField;
    }

    public void setMonthField(String monthField) {
        this.monthField = monthField;
    }
}
